﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RentHouse.IService;

namespace RentHouse.Admin.Controllers
{
    public class HouseAppointmentController : Controller
    {
        private readonly IHouseAppointmentService _houseAppointmentService;
        public HouseAppointmentController(IHouseAppointmentService houseAppointmentService)
        {
            this._houseAppointmentService = houseAppointmentService;
        }
        // GET: HouseAppointment
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetList(int start,int length)
        {
            int count=0;
            var list = _houseAppointmentService.GetHouseAppointmentsList(start, length, ref count);
            var result = new {
                data=list,
                recordsTotal = count,
                recordsFiltered = count
            };
            return Json(result);

        }
        [HttpPost]
        public ActionResult Follow(int id)
        {  
  
            long adminUserId = 65;
            return Json(_houseAppointmentService.Follow(id, adminUserId));
        
        }
    }
}